package com.lingnan.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lingnan.entity.po.CompanyHr;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;

public interface CompanyHrMapper extends BaseMapper<CompanyHr> {
    CompanyHr selectByUserAccountId(Long senderId);
    @Select("SELECT COUNT(*) FROM company_hr WHERE MONTH(created_at) = #{month}")
    long countByMonth(@Param("month") int month);

    @Select("SELECT COUNT(*) FROM company_hr WHERE created_at BETWEEN #{startDate} AND #{endDate}")
    long countByDateRange(@Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);
}
